home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / packet / terminal / top_152 / src152.exe / rar / TOPLIB.PAS < prev    next >
Pascal/Delphi Source File  |  1995-05-16  |  33KB  |  1,457 lines

  1. {┌─────────────────────────────────────────────────────────────────────────┐}
  2. {│                                                                         │}
  3. {│                              T. O. P.                                   │}
  4. {│                                                                         │}
  5. {│                        (T)he  (O)ther  (P)acket                         │}
  6. {│                                                                         │}
  7. {│ T O P L I B . P A S                                                     │}
  8. {│                                                                         │}
  9. {│                                                                         │}
  10. {│ Library - Unit mit oft benötigten Routinen                              │}
  11. {└─────────────────────────────────────────────────────────────────────────┘}
  12.  
  13.  
  14. Function  Channel_ID (* Kanal : Byte) : Str5 *);
  15. Var    Bstr : String[5];
  16. Begin
  17.   Bstr := TNC[K[Kanal]^.TncNummer]^.Ident;
  18.   if length(Bstr) > 0 then Bstr := Bstr + B1;
  19.   Channel_ID := Bstr;
  20. End;
  21.  
  22.  
  23. Procedure Warten;
  24. Var  KC : Sondertaste;
  25.      VC : Char;
  26. Begin
  27.   Repeat Until _Keypressed;
  28.   _ReadKey(KC,VC);
  29. End;
  30.  
  31.  
  32. Procedure Triller;
  33. Var  i : Byte;
  34. Begin
  35.   for i := 1 to 6 do
  36.   begin
  37.     Beep(600,50);
  38.     Beep(800,50);
  39.   end;
  40. End;
  41.  
  42.  
  43. Procedure C_Bell;         
  44. Var  i : Byte;
  45. Begin
  46.   if Klingel then for i := 1 to 10 do
  47.   begin
  48.     Beep(G^.C_Freq1,G^.C_Delay1);
  49.     Beep(G^.C_Freq2,G^.C_Delay2);
  50.   end;
  51. End;
  52.  
  53.  
  54. Procedure D_Bell;         (* Klingel beim Disconnect *)
  55. Var i : Integer;
  56. Begin
  57.   i := 2000;
  58.   Repeat
  59.     i := i-25;
  60.     Sound(i);
  61.     Verzoegern(1);
  62.   Until i < 100;
  63.   NoSound;
  64. End;
  65.  
  66.  
  67. Procedure Daten_Bell;
  68. Begin
  69.   Sound(1400);
  70.   Verzoegern(100);
  71.   NoSound;
  72.   Verzoegern(80);
  73.   Sound(1400);
  74.   Verzoegern(40);
  75.   NoSound;
  76. End;
  77.  
  78.  
  79. Function Datum (* : Str11 *);
  80. Var    Tag,
  81.        WoTag,
  82.        Monat,
  83.        Jahr      : Word;
  84.        TagStr,
  85.        WoTagStr,
  86.        MonatStr,
  87.        JahrStr   : String[2];
  88.        Dummy     : String[8];
  89.  
  90. Begin
  91.   GetDate(Jahr,Monat,Tag,WoTag);
  92.   Dummy := Uhrzeit;
  93.  
  94.   TagStr := SFillStr(2,'0',int_str(Tag));
  95.   MonatStr := SFillStr(2,'0',int_str(Monat));
  96.   JahrStr := copy(int_str(Jahr),3,2);
  97.  
  98.   WochenTag := ParmStr(WoTag+1,B1,WeekDayStr);
  99.   WotagStr := copy(WochenTag,1,2);
  100.  
  101.   Datum := WotagStr + B1 + TagStr + Pkt  + MonatStr + Pkt  + JahrStr;
  102. End;
  103.  
  104.  
  105. Function Uhrzeit (* : Str8 *);
  106. Var   Stunden,
  107.       Minuten,
  108.       Sekunden,
  109.       Sek100,
  110.       UtcStd   : Word;
  111.       Flag     : Boolean;
  112.       Hstr     : String[8];
  113. Begin
  114.   GetTime(Stunden,Minuten,Sekunden,Sek100);
  115.  
  116.   UtcStd := Stunden;
  117.   UtcStd := UtcStd + 24 + ZeitDiff;
  118.   While UtcStd > 23 do UtcStd := UtcStd - 24;
  119.  
  120.   Hstr := SFillStr(2,'0',int_str(Stunden)) + DP +
  121.           SFillStr(2,'0',int_str(Minuten)) + DP +
  122.           SFillStr(2,'0',int_str(Sekunden)) + DP;
  123.  
  124.   UtcZeit := SFillStr(2,'0',int_str(UtcStd)) + copy(Hstr,3,6);
  125.   Uhrzeit := Hstr;
  126. End;
  127.  
  128.  
  129. Function GetCursorSize : Integer; (* Liefert Cursorgroesse (aus PCT von DD6CV) *)
  130. Var   r : Registers;
  131. Begin
  132.   r.AH := $03;
  133.   intr($10,r);
  134.   GetCursorSize := r.CX;
  135. End;
  136.  
  137.  
  138. Procedure SetCursorSize(Size : Integer); (* Setzt Cursorgroesse (aus PCT von DD6CV) *)
  139. Var  r : Registers;
  140. Begin
  141.   r.AH := $01;
  142.   r.CX := Size;
  143.   intr($10,r);
  144. End;
  145.  
  146.  
  147. Procedure Cursor_aus;      (* Schaltet Cursor aus. (aus PCT von DD6CV) *)
  148. Const CursorOffBit = 8192;
  149. Begin
  150.   SetCursorSize(GetCursorSize or CursorOffBit);
  151.   Cursor_On := false;
  152. End;
  153.  
  154.  
  155. Procedure Cursor_ein;     (* Schaltet Cursor ein.  (aus PCT von DD6CV) *)
  156. Const CursorOnMask = -8193;
  157. Begin
  158.   SetCursorSize(GetCursorSize and CursorOnMask);
  159.   Cursor_On := true;
  160. End;
  161.  
  162.  
  163. Procedure Beep (* Ton,Laenge : Word*);
  164. Begin
  165.   if Laenge > 0 then
  166.   begin
  167.     NoSound;
  168.     Sound(Ton);
  169.     Verzoegern(Laenge);
  170.     NoSound;
  171.   end;
  172. End;
  173.  
  174.  
  175. Procedure Fenster;
  176. Var  i,x,y : Byte;
  177.      Attr  : Byte;
  178.  
  179. Begin
  180.   Attr := Attrib[3];
  181.   x := 1;
  182.   Teil_Bild_Loesch(7,15,Attr);
  183.   x := 40-(length(G^.Fstr[7]) DIV 2);
  184.   WriteRam(x,7,Attr,1,G^.Fstr[7]);
  185.   WriteRam(1,8,Attr,1,ConstStr('═',80));
  186.   for i := 9 to 15 do WriteRam(G^.Fstx[i],i,Attr,1,G^.Fstr[i]);
  187. End;
  188.  
  189.  
  190. Procedure clrFenster;
  191. Var       i : Byte;
  192. Begin
  193.   for i := 7 to 15 do G^.Fstr[i] := '';
  194.   for i := 7 to 15 do G^.Fstx[i] := 1;
  195. End;
  196.  
  197.  
  198. Procedure Status2;
  199. Var   AByte,
  200.       Beg,
  201.       Ende,
  202.       C,i,
  203.       Z,UT : Byte;
  204.       ch   : Char;
  205.       Hstr : String[80];
  206.       Xstr : String[6];
  207.       Flag : Boolean;
  208.  
  209. Begin
  210.   i := 0;
  211.   Repeat
  212.     Flag := not (i in [Portstufe+1..Portstufe+10]) and K[i]^.connected;
  213.     inc (i);
  214.   Until (i > maxLink) or Flag;
  215.  
  216.   if Flag then ch := '*'
  217.           else ch := B1;
  218.  
  219.   Hstr := ch;
  220.  
  221.   Beg := PortStufe + 1;
  222.   Ende := Beg + 9;
  223.   if Ende > maxLink then Ende := maxLink;
  224.   for C := Beg to Ende do with K[C]^ do
  225.   begin
  226.     if connected then
  227.     begin
  228.       Xstr := Call;
  229.       Strip(Xstr);
  230.     end else
  231.     if Test then Xstr := 'T (' + int_str(TestMerk) + ')' else
  232.     begin
  233.       if Kstat then Xstr := EFillStr(6,B1,SFillStr(4,B1,int_str(C)))
  234.                else Xstr := ConstStr('─',6);
  235.     end;
  236.  
  237.     if Mo.MonActive then
  238.     begin
  239.       Xstr := CutStr(Mo.MonStr[1]);
  240.       strip(Xstr);
  241.     end;
  242.     if (C > 0) and (C = ConvHilfsPort) then Xstr := 'SYSOP';
  243.     Xstr := EFillStr(6,B1,Xstr);
  244.     Hstr := Hstr + KStatTr;
  245.     Hstr := Hstr + Xstr;
  246.   end;
  247.   Hstr := Hstr + KStatTr;
  248.   Hstr := EFillStr(80,B1,Hstr);
  249.   UT := K[show]^.UnStat;
  250.   WriteRam(1,UT,Attrib[15],1,Hstr);
  251.   if show = 0 then i := Unproto
  252.               else i := K[show]^.TncNummer;
  253.    WriteRam(73,UT,Attrib[30],1,SFillStr(8,B1,TNC[i]^.QRG_Akt));
  254.  
  255.   Z := 0;
  256.   for C := Beg to Ende do
  257.   begin
  258.     inc(Z);
  259.     with K[C]^ do
  260.     begin
  261.       if (show = C)
  262.          then AByte := Attrib[17]
  263.          else if NochNichtGelesen then AByte := Attrib[8]
  264.          else if Mo.MonActive then AByte := Attrib[25]
  265.          else if connected then AByte := Attrib[16]
  266.          else AByte := Attrib[15];
  267.       WriteAttr((Z*6)+Z-4,UT,6,AByte,1);
  268.     end;
  269.   end;
  270.  
  271.   if maxLink > 10 then for C := 1 to maxLink do with K[C]^ do
  272.   begin
  273.     if NochNichtGelesen and not (C in [(Portstufe+1)..(Portstufe+10)]) then
  274.     begin
  275.       Hstr := EFillStr(6,B1,'CH:' + int_str(C));
  276.       Z := C mod 10;
  277.       if Z = 0 then Z := 10;
  278.       i := show mod 10;
  279.       if i = 0 then i := 10;
  280.       if Z <> i then AByte := Attrib[8]
  281.                 else AByte := Attrib[17];
  282.       WriteRam((Z*6)+Z-4,UT,AByte,1,Hstr);
  283.     end;
  284.   end;
  285. End;
  286.  
  287.  
  288. Procedure Alarm;
  289. Begin
  290.   if Klingel then Beep(G^.Alarm_Freq,G^.Alarm_Time);
  291. End;
  292.  
  293.  
  294. Procedure StatusOut (* Kanal,x,Nr,Attr : Byte ; Zeile : str20 *);
  295. Var   N,Nx,i : Byte;
  296. Begin
  297.   with K[Kanal]^ do
  298.   begin
  299.     N := (((NrStat[Nr]-1) * 40) + (2 * x) - 1);
  300.     Nx := (NrStat[Nr]-1) * 40 + 1;
  301.     for i := 1 to ord(Zeile[0]) do
  302.     begin
  303.       StatZeile[N] := Zeile[i];
  304.       inc(N);
  305.       StatZeile[N] := chr(Attr);
  306.       inc(N);
  307.     end;
  308.     if not ScreenSTBY then
  309.     begin
  310.       if (Kanal = show) and not DirScroll then
  311.       begin
  312.         if Backscroll(show) and (Nr <> 2)
  313.          then move(StatZeile[Nx],Bild^[(ObStat-1)*160+Nx],40)
  314.          else move(StatZeile,Bild^[(ObStat-1)*160+1],160);
  315.       end;
  316.     end;
  317.   end;
  318. End;
  319.  
  320.  
  321. Procedure NodeConnect (* Kanal : Byte; Zeile : Str80 *);
  322. Var  i    : Byte;
  323.      Bstr,
  324.      Hstr : String[80];
  325. Begin
  326.   with K[Kanal]^ do
  327.   begin
  328.     Hstr := Zeile;
  329.     if length(Zeile) > 1 then NodeCmd := false;
  330.     Zeile := CutStr(Zeile);
  331.  
  332.     if Zeile > '' then
  333.     begin
  334.       Bstr := InfoZeile(216);
  335.       while (Bstr > '') and not NodeCmd do
  336.       begin
  337.         if pos(Zeile,CutStr(Bstr)) = 1 then NodeCmd := true
  338.                                        else Bstr := RestStr(Bstr);
  339.       end;
  340.       if NodeCmd then ConnectMerk := Hstr;
  341.     end;
  342.   end;
  343. End;
  344.  
  345.  
  346. Function  Exists (* name : Str80) : Boolean *);
  347. Var       Datei  : Text;
  348. Begin
  349.   if Name > '' then
  350.   begin
  351.     Assign(Datei,name);
  352.     (*$I-*) Reset(Datei); (*$I+*)
  353.     if IOResult = 0 then
  354.     begin
  355.       Exists := true;
  356.       Close(Datei);
  357.     end else Exists := false;
  358.   end else Exists := false;
  359. End;
  360.  
  361.  
  362. Procedure Teil_Bild_Loesch (* y,y1,Attr : Byte *); (* Zeilen von y bis y1 löschen *)
  363. Begin
  364.   if not ScreenSTBY then
  365.   Asm   les  di, Bild
  366.  
  367.         mov  al, y
  368.         dec  al
  369.         mov  ah, 160
  370.         mul  ah
  371.         add  di, ax
  372.  
  373.         mov  al, y1
  374.         mov  ah, 160
  375.         mul  ah
  376.         sub  ax, di
  377.         mov  cx, ax
  378.  
  379.         mov  al, 32
  380.         mov  ah, Attr             { Attribut laden  }
  381.         shr  cx, 1
  382. @Again:
  383.         mov  [es:di], ax          { Zeichen mit Attr übertragen }
  384.         add  di, 2
  385.         Loop @Again
  386.  
  387.   end;
  388. End;
  389.  
  390.  
  391. Procedure InfoOut;    (* Kanal,AL,NewPic : Byte; Zeile : Str80 *)
  392. Var     AMerk,
  393.         Tr,x,l : Byte;
  394. Begin
  395.   if length(Zeile) > 78 then Zeile[0] := Chr(78);
  396.  
  397.   if (Kanal = show) and not BackScroll(Kanal) then
  398.   begin
  399.     if NewPic = 1 then Neu_Bild;
  400.     if Kanal > 0 then Tr := K[Kanal]^.QBeg
  401.                  else Tr := K[Kanal]^.UnStat + 1;
  402.     if not HardCur and (length(Zeile) < 76) then Zeile := B1 + Zeile + B1;
  403.     if volle_Breite then Zeile := EFillStr(78,B1,Zeile);
  404.     l := length(Zeile);
  405.     x := (80 - l) div 2;
  406.     XL := x;
  407.     XR := x + l + 2;
  408.     WriteRam(x,Tr,15,1,'┌' + ConstStr('─',l) + '┐');
  409.     WriteRam(x,Tr+1,15,1,'│' + Zeile + '│');
  410.     WriteAttr(x+1,Tr+1,l,Attrib[3],1);
  411.     WriteRam(x,Tr+2,15,1,'└' + ConstStr('─',l) + '┘');
  412.     if LastInfoFlag then
  413.        WriteRam(x+1,Tr,15,1,B1+int_str(LastInfoOut^.KA[LastInfoCount])+B1);
  414.     NowFenster := true;
  415.     BoxZaehl := Box_Time;
  416.     NowCurBox := true;
  417.     if (AL = 1) and Klingel then Beep(G^.PopFreq,G^.PopFreqTime);
  418.  
  419.     if not LastInfoFlag then
  420.     begin
  421.       for l := maxInfoOut-1 downto 1 do
  422.       begin
  423.         LastInfoOut^.IZ[l+1] := LastInfoOut^.IZ[l];
  424.         LastInfoOut^.KA[l+1] := LastInfoOut^.KA[l];
  425.       end;
  426.       LastInfoCount := 0;
  427.       LastInfoOut^.IZ[1] := Zeile;
  428.       LastInfoOut^.KA[1] := Kanal;
  429.       KillEndBlanks(LastInfoOut^.IZ[1]);
  430.       KillStartBlanks(LastInfoOut^.IZ[1]);
  431.     end;
  432.     set_Hardwarecursor(Kanal);
  433.     K[Kanal]^.MerkInfo := '';
  434.   end else K[Kanal]^.MerkInfo := Zeile;
  435. End;
  436.  
  437.  
  438. Procedure max_path_ermitteln;
  439. Var       Hstr : String[80];
  440. Begin
  441.   maxPath := 0;
  442.   FiResult := ResetTxt(G^.LinkFile);
  443.   Repeat
  444.     Readln(G^.LinkFile,Hstr);
  445.     if pos(DP,Hstr) > 0 then inc(maxPath);
  446.   Until Eof(G^.LinkFile);
  447.   FiResult := CloseTxt(G^.LinkFile);
  448. End;
  449.  
  450.  
  451. Procedure WriteAttr (* X_Pos,Y_Pos,Count,Attr,Aufruf : Byte *);
  452. Begin
  453.   if not ScreenSTBY then
  454.   begin
  455.     if not ((Aufruf = 0) and BackScroll(show)) then
  456.     Asm   xor  ch, ch
  457.           mov  cl, Count
  458.           cmp  cl, 0
  459.           je   @Ende
  460.  
  461.           les  di, Bild
  462.  
  463.           mov  al, Y_Pos
  464.           dec  al
  465.           mov  ah, 160
  466.           mul  ah
  467.           add  di, ax
  468.  
  469.           mov  al, X_Pos
  470.           shl  al, 1
  471.           dec  al
  472.           xor  ah, ah
  473.           add  di, ax
  474.  
  475.           mov  al, Attr         { Attribut laden, }
  476.    @Again:
  477.           mov  [es:di], al       { und schreiben }
  478.           add  di, 2
  479.           loop @Again
  480.    @Ende:
  481.  
  482.     end;
  483.   end;
  484. End;
  485.  
  486.  
  487. Procedure WritePage (* Kanal,X_Pos,Y_Pos,Attr,Aufruf : Byte ; Zeile : Str80 *);
  488. Var  Attr1 : Byte;
  489. Begin
  490.   if not ScreenSTBY then
  491.   begin
  492.     if (Aufruf = 1) or (Kanal = show) then
  493.     begin
  494.       Attr1 := Attrib[1];
  495.       AusStr := Zeile;
  496.       Asm   mov  si, Offset AusStr
  497.             xor  ch, ch
  498.             mov  cl, [ds:si]
  499.         test cl, $FF
  500.             jz   @Ende
  501.             inc  si
  502.  
  503.             les  di, Bild
  504.  
  505.             mov  al, Y_Pos
  506.             mov  ah, 160
  507.             dec  al
  508.             mul  ah
  509.             mov  di, ax
  510.             mov  al, X_Pos
  511.             shl  al, 1
  512.             dec  al
  513.             dec  al
  514.             xor  ah, ah
  515.             add  di, ax
  516.             cld
  517.     @Again:
  518.             mov  ah, Attr
  519.             lodsb
  520.             cmp  al, 32
  521.             jae  @Weiter
  522.             test al, $FF
  523.             jz   @Weiter
  524.  
  525.             mov  bl, WCTRL
  526.             test bl, $FF
  527.             jz   @1
  528.             mov  ah, Attr1
  529.             add  al, 64
  530.         @1:
  531.  
  532.    @Weiter:
  533.             mov  [es:di], ax
  534.             add  di, 2
  535.             Loop @Again
  536.     @Ende:
  537.  
  538.       end;
  539.     end;
  540.   end;
  541. End;
  542.  
  543.  
  544. {
  545. Procedure WritePage (* Kanal,X_Pos,Y_Pos,Attr : Byte ; Zeile : Str80 *);
  546. var Attr1,i   : Byte;
  547.     ch        : char;
  548.     Position  : Integer;
  549.     aktuell   : Boolean;
  550. Begin
  551.   if not ScreenSTBY then
  552.   begin
  553.     if (Aufruf = 1) or (Kanal = show) then
  554.     begin
  555.       Position := pred(Y_Pos) * 160 + pred(X_Pos shl 1);
  556.       for i := 1 to length(Zeile) do
  557.       Begin
  558.         ch := Zeile[i];
  559.         if ch < #32 then
  560.         begin
  561.           Attr1 := Attrib[1];
  562.           if WCTRL then ch := chr(ord(ch) + 64);
  563.         end else Attr1 := Attr;
  564.         Bild^[Position] := ch;
  565.         inc(Position);
  566.         Bild^[Position] := chr(Attr1);
  567.         inc(Position);
  568.       end;
  569.     end;
  570.   end;
  571. End;
  572. }
  573.  
  574.  
  575. Procedure WriteRam (* X_Pos,Y_Pos,Attr,Aufruf : Byte; Zeile : Str80 *);
  576. Begin
  577.   if not ScreenSTBY then
  578.   begin
  579.     if not ((Aufruf = 0) and BackScroll(show)) then
  580.     begin
  581.       AusStr := Zeile;
  582.       Asm   mov  si, Offset AusStr
  583.             xor  ch, ch
  584.             mov  cl, [ds:si]
  585.         test cl, $FF
  586.             jz   @Ende
  587.             inc  si
  588.  
  589.             les  di, Bild
  590.  
  591.             mov  al, Y_Pos
  592.             mov  ah, 160
  593.             dec  al
  594.             mul  ah
  595.             mov  di, ax
  596.             mov  al, X_Pos
  597.             shl  al, 1
  598.             sub  al, 2
  599.             xor  ah, ah
  600.             add  di, ax
  601.             mov  ah, Attr
  602.  
  603.             cld
  604.     @Again:
  605.             lodsb
  606.             mov  [es:di], ax
  607.             add  di, 2
  608.             Loop @Again
  609.     @Ende:
  610.       end;
  611.     end;
  612.   end;
  613. End;
  614.  
  615. {
  616. Procedure WriteRam(X_Pos,Y_Pos,Attr,Aufruf : Byte ; Zeile : Str80);
  617. var i         : Byte;
  618.     ch        : char;
  619.     ch1       : char;
  620.     Position  : Integer;
  621. Begin
  622.   if not ScreenSTBY then
  623.   begin
  624.     ch1 := chr(Attr);
  625.     Position := (pred(Y_Pos) * 160) + pred(X_Pos shl 1);
  626.     if not ((Aufruf = 0) and BackScroll(show)) then
  627.     begin
  628.       for i := 1 to ord(Zeile[0]) do
  629.       Begin
  630.         Bild^[Position] := Zeile[i];
  631.         Position := Succ(Position);
  632.         Bild^[Position] := ch1;
  633.         Position := Succ(Position);
  634.       end;
  635.     end;
  636.   end;
  637. End;
  638. }
  639.  
  640. Procedure WriteTxt (* X_Pos,Y_Pos,Attr : Byte; Zeile : Str80 *);
  641. Begin
  642.   AusStr := Zeile;
  643.   Asm  mov  si, Offset AusStr
  644.        xor  ch, ch
  645.        mov  cl, [ds:si]
  646.        test cl, $FF
  647.        jz   @Ende
  648.        inc  si
  649.  
  650.        les  di, Bild
  651.  
  652.        mov  al, Y_Pos
  653.        mov  ah, 160
  654.        dec  al
  655.        mul  ah
  656.        mov  di, ax
  657.        mov  al, X_Pos
  658.        shl  al, 1
  659.        sub  al, 2
  660.        xor  ah, ah
  661.        add  di, ax
  662.        mov  ah, Attr
  663.  
  664.        cld
  665. @Again:
  666.        lodsb
  667.        mov  [es:di], ax
  668.        add  di, 2
  669.        Loop @Again
  670.  @Ende:
  671.   end;
  672. End;
  673.  
  674.  
  675. Procedure WriteBios (* Kanal,X_Pos,Y_Pos,Attr,Aufruf : Byte ; Zeile : Str80 *);
  676. Var  XM,YM,i,
  677.      Attr1  : Byte;
  678.      VC     : Char;
  679.      Reg    : Registers;
  680.  
  681. Begin
  682.   if not ScreenSTBY then
  683.   begin
  684.     if (Aufruf = 1) or (Kanal = show) then
  685.     begin
  686.       XM := WhereX;
  687.       YM := WhereY;
  688.       Attr1 := Attrib[1];
  689.       for i := 1 to length(Zeile) do
  690.       begin
  691.         VC := Zeile[i];
  692.  
  693.         Reg.AH := $02;
  694.         Reg.BH := $00;
  695.         Reg.DH := Y_Pos - 1;
  696.         Reg.DL := X_Pos - 1;
  697.         Intr($10,Reg);
  698.  
  699.         if WCTRL and (Ord(VC) in [1..31]) then
  700.         begin
  701.           Reg.AH := $09;
  702.           Reg.AL := Ord(VC) + 64;
  703.           Reg.BH := $00;
  704.           Reg.BL := Attr1;
  705.           Reg.CX := $01;
  706.           Intr($10,Reg);
  707.         end else
  708.         begin
  709.           Reg.AH := $09;
  710.           Reg.AL := Ord(VC);
  711.           Reg.BH := $00;
  712.           Reg.BL := Attr;
  713.           Reg.CX := $01;
  714.           Intr($10,Reg);
  715.         end;
  716.         inc(X_Pos);
  717.       end;
  718.       GotoXY(XM,YM);
  719.     end;
  720.   end;
  721. End;
  722.  
  723.  
  724. Function  KanalFrei (* Kanal : Byte) : Byte *);
  725. Var    Free : Boolean;
  726.        i    : Byte;
  727. Begin
  728.   Free := false;
  729.   i := maxLink;
  730.   While not Free and (i > 0) do with K[i]^ do
  731.   begin
  732.     if not Kanal_benutz and
  733.        not connected and
  734.        not Test and
  735.        not Mo.MonActive and
  736.        (Cself = 0) and
  737.        (i <> ConvHilfsPort) and
  738.        (i <> Kanal) then
  739.     begin
  740.       Free := true;
  741.       KanalFrei := i;
  742.     end else dec(i);
  743.   end;
  744.   if not Free then KanalFrei := 0;
  745. End;
  746.  
  747.  
  748. Function Line_convert (* Kanal, Art : Byte; Zeile : String) : String *);
  749. Var    i : Byte;
  750. Begin
  751.   with K[Kanal]^ do
  752.   begin
  753.     if Umlaut = 2 then
  754.     begin
  755.       case Art of
  756.         1 : For i := 1 to length(Zeile) do
  757.             case Zeile[i] of
  758.               'Ä' : Zeile[i] := '[';
  759.               'Ö' : Zeile[i] := BS ;
  760.               'Ü' : Zeile[i] := ']';
  761.               'ä' : Zeile[i] := '{';
  762.               'ö' : Zeile[i] := '|';
  763.               'ü' : Zeile[i] := '}';
  764.               'ß' : Zeile[i] := '~';
  765.             end;
  766.         2 : For i := 1 to length(Zeile) do
  767.             case Zeile[i] of
  768.               '[' : Zeile[i] := 'Ä';
  769.               BS  : Zeile[i] := 'Ö';
  770.               ']' : Zeile[i] := 'Ü';
  771.               '{' : Zeile[i] := 'ä';
  772.               '|' : Zeile[i] := 'ö';
  773.               '}' : Zeile[i] := 'ü';
  774.               '~' : Zeile[i] := 'ß';
  775.             end;
  776.       end;
  777.     end
  778.  
  779.     else if Umlaut = 3 then
  780.     begin
  781.       case Art of
  782.         1 : For i := 1 to length(Zeile) do
  783.             case Zeile[i] of
  784.               'Ä' : Zeile[i] := '─';
  785.               'Ö' : Zeile[i] := '╓';
  786.               'Ü' : Zeile[i] := '▄';
  787.               'ä' : Zeile[i] := 'Σ';
  788.               'ö' : Zeile[i] := '÷';
  789.               'ü' : Zeile[i] := 'ⁿ';
  790.               'ß' : Zeile[i] := '▀';
  791.             end;
  792.         2 : For i := 1 to length(Zeile) do
  793.             case Zeile[i] of
  794.               '─' : Zeile[i] := 'Ä';
  795.               '╓' : Zeile[i] := 'Ö';
  796.               '▄' : Zeile[i] := 'Ü';
  797.               'Σ' : Zeile[i] := 'ä';
  798.               '÷' : Zeile[i] := 'ö';
  799.               'ⁿ' : Zeile[i] := 'ü';
  800.               '▀' : Zeile[i] := 'ß';
  801.             end;
  802.         end;
  803.       end;
  804.     end;
  805.   Line_convert := Zeile;
  806. End;
  807.  
  808.  
  809. Function InfoZeile;         (*  (Nr : Word) : String[80]  *)
  810. Var   Hstr : String[80];
  811.       i,x  : Word;
  812. Begin
  813.   Hstr := '';
  814.   x := (MsgPos^[Nr+1] - MsgPos^[Nr]);
  815.   move(Msg^[MsgPos^[Nr]],Hstr[1],x);
  816.   Hstr[0] := chr(Byte(x));
  817.   InfoZeile := Hstr;
  818. End;
  819.  
  820.  
  821. Procedure Neu_Bild;
  822. Const  ScrMax = NeuBildRam + 1;
  823.        RetMax = 60;
  824.  
  825. Type   ScreenPtr = array[0..ScrMax] of Byte;
  826.        ReturnPtr = array[0..RetMax] of Word;
  827.  
  828. Var    Zeilen,i : Integer;
  829.        Screen   : ^ScreenPtr;
  830.        Return   : ^ReturnPtr;
  831.  
  832.   Procedure Picture(C,von,bis,Attr : Byte);
  833.   Var   i1       : Integer;
  834.         Farb,
  835.         Z,J      : Byte;
  836.         Groesse,
  837.         P        : LongInt;
  838.         Hstr     : String[80];
  839.         ch       : char;
  840.         i        : Word;
  841.         NotPtr   : Pointer;
  842.         RetPtr   : Pointer;
  843.  
  844.   Begin
  845.     FillChar(Return^,SizeOf(Return^),0);
  846.     FillChar(Screen^,SizeOf(Screen^),0);
  847.     Return^[0] := ScrMax-1;
  848.     if use_EMS then EMS_Seite_einblenden(C,Scr);
  849.  
  850.     if use_Vdisk then
  851.     begin
  852.       FiResult := ResetBin(ScrollFile,T);
  853.       with K[C]^ do
  854.       if NotPos + 1 < ScrMax then
  855.       begin
  856.         Seek(ScrollFile,Pos_im_Scr+(maxNotCh-ScrMax+NotPos));
  857.         BlockRead(ScrollFile,Screen^[0],ScrMax-NotPos-1,i);
  858.         Seek(ScrollFile,Pos_im_Scr);
  859.         BlockRead(ScrollFile,Screen^[ScrMax-NotPos-1],NotPos,i);
  860.       end else
  861.       begin
  862.         Seek(ScrollFile,Pos_im_Scr+(NotPos+1-ScrMax));
  863.         BlockRead(ScrollFile,Screen^[0],ScrMax-1,i);
  864.       end;
  865.       FiResult := CloseBin(ScrollFile);
  866.     end else
  867.  
  868.     if use_XMS then
  869.     begin
  870.       with K[C]^ do if NotPos + 1 < ScrMax then
  871.       begin
  872.         XMS_to_Data(@Screen^[0],XMS_Handle,Pos_im_Scr+(maxNotCh-ScrMax+NotPos),ScrMax-NotPos-1);
  873.         XMS_to_Data(@Screen^[ScrMax-NotPos-1],XMS_Handle,Pos_im_Scr,NotPos);
  874.       end else XMS_to_Data(@Screen^[0],XMS_Handle,Pos_im_Scr+(NotPos+1-ScrMax),ScrMax-1);
  875.     end else
  876.     begin
  877.       with K[C]^ do if NotPos + 1 < ScrMax then
  878.       begin
  879.         move(NotCh[C]^[maxNotCh-ScrMax+NotPos],Screen^[0],ScrMax-NotPos-1);
  880.         move(NotCh[C]^[0],Screen^[ScrMax-NotPos-1],NotPos);
  881.       end else move(NotCh[C]^[NotPos+1-ScrMax],Screen^[0],ScrMax-1);
  882.     end;
  883.  
  884.     Screen^[ScrMax-1] := 13;
  885.  
  886.     NotPtr := @Screen^[ScrMax-2];
  887.     RetPtr := @Return^[0];
  888.     Asm   cli
  889.           push DS
  890.  
  891.           mov  cx, ScrMax
  892.           dec  cx
  893.           dec  cx
  894.           xor  bl, bl
  895.           
  896.           lds  si, RetPtr
  897.           les  di, NotPtr
  898.           jmp  @Again
  899.   @AddZ:
  900.           add  si, 2
  901.           mov  [ds:si], cx
  902.           dec  cx
  903.           inc  bl
  904.           cmp  bl, RetMax
  905.           jae  @Ende
  906.   @Again:
  907.           mov  al, [es:di]
  908.           dec  di
  909.           cmp  al, 13
  910.           je   @AddZ
  911.           Loop @Again
  912.   @Ende:
  913.           pop  DS
  914.           mov  Z, bl
  915.           sti
  916.     end;
  917.  
  918.  
  919.     (*
  920.     Z := 0;
  921.     for i := max-2 downto 0 do
  922.     begin
  923.       if (Screen^[i] = 13) and (Z < a) then
  924.       begin
  925.         inc(Z);
  926.         RET[Z] := i;
  927.       end;
  928.     end;
  929.     *)
  930.  
  931.  
  932.     if Zeilen <= Z then Z := Zeilen;
  933.     for i := 1 to Z do
  934.     begin
  935.       Hstr := '';
  936.       Farb := ord(Screen^[Return^[i]+1]);
  937.       if Farb = 254 then Farb := 13;
  938.       J := Return^[i-1] - Return^[i] - 2;
  939.       if J > 80 then J := 80;
  940.       move(Screen^[Return^[i]+2],Hstr[1],J);
  941.       Hstr[0] := chr(J);
  942.       Teil_Bild_Loesch(bis+1-i,bis+1-i,Farb);
  943.       WritePage(show,1,bis+1-i,Farb,0,Hstr);
  944.     end;
  945.     if (bis-Z) >= von then Teil_Bild_Loesch(von,bis-Z,Attr);
  946.   end;
  947.  
  948. Begin
  949.   NowFenster := false;
  950.   NowCurBox := false;
  951.   ScreenSTBY := false;
  952.   SetzeFlags(show);
  953.   Status2;
  954.  
  955.   GetMem(Screen,SizeOf(Screen^));
  956.   GetMem(Return,SizeOf(Return^));
  957.  
  958.   if show = 0 then
  959.   begin
  960.     Zeilen := maxZ - K[0]^.UnStat;
  961.     Picture(0,K[0]^.UnStat+1,maxZ,Attrib[29]);
  962.     TickerOut;
  963.   end else
  964.   begin
  965.     Zeilen := K[show]^.QEnd - K[show]^.QBeg + 1;
  966.     Picture(show,K[show]^.QBeg,K[show]^.QEnd,Attrib[18]);
  967.     Zeilen := maxZ - K[show]^.UnStat;
  968.     if Zeilen > 0 then Picture(0,K[show]^.UnStat+1,maxZ,Attrib[29]);
  969.   end;
  970.  
  971.   FreeMem(Return,SizeOf(Return^));
  972.   FreeMem(Screen,SizeOf(Screen^));
  973.  
  974.   Neu_BildVor(show);
  975.   Soft_Cursor(show);
  976.   if HardCur then
  977.   begin
  978.     JumpRxZaehl := 0;
  979.     JumpRxScr := true;
  980.   end;
  981.   notScroll := true;
  982.   if not BackScroll(show) and (K[show]^.MerkInfo > '') then
  983.     InfoOut(show,0,0,K[show]^.MerkInfo);
  984. End;
  985.  
  986.  
  987. Procedure SetzeFlags (* Kanal : Byte *);
  988. Var  S    : String[20];
  989.  
  990.   Procedure mS (Hstr : Str2);
  991.   Begin
  992.     S := S + Hstr;
  993.   End;
  994.  
  995. Begin
  996.   with K[Kanal]^ do
  997.   begin
  998.     StatusOut(Kanal,1,3,Attrib[9],ConstStr(B1,20));
  999.     S := '';
  1000.  
  1001.     if Kanal > 0 then
  1002.     begin
  1003.       if Einstiegskanal or AusstiegsKanal then mS(int_str(GegenKanal));
  1004.       if Kopieren > 0 then mS(int_str(Kopieren));
  1005.       if FileSend then mS('Tx');
  1006.       if RX_Bin > 0 then mS('Rx');
  1007.       if SplSave then mS('*')
  1008.                  else if SPlus  then mS('+');
  1009.       if BufExists then mS('%');
  1010.       if AutoBin then mS('&');
  1011.       if RemAll then mS('!');
  1012.       if Ignore then mS('-');
  1013.       if not BinOut then mS('#');
  1014.       if SysopParm then mS('s');
  1015.       if SysArt in SysMenge then mS('B')
  1016.                                 else if Auto then mS('F');
  1017.       if Auto_CON then mS('c');
  1018.       if Rx_Beep then mS('G');
  1019.       if Hold and not FileSend then mS('H');
  1020.       if CSelf in [5,6] then mS('a')
  1021.                         else if CSelf > 0 then mS('A');
  1022.     end else
  1023.     begin
  1024.       if CtrlBeep then mS('G');
  1025.       if PacOut then mS('L');
  1026.       if Time_stamp then mS('T');
  1027.       if TNC[Unproto]^.Bake then mS('B');
  1028.       if NoBinMon then mS('#');
  1029.     end;
  1030.     if TopBox then if EigMail then mS('m')
  1031.                               else mS('M');
  1032.     if RxComp then mS('r');
  1033.     if TxComp then mS('t');
  1034.  
  1035.     if not RX_Save and Save then mS('Sv');
  1036.     if Umlaut > 0 then mS('U');
  1037.     if Echo > 0 then mS('E');
  1038.     if Klingel then mS('K');
  1039.     if Print then if Drucker then mS('P')
  1040.                              else mS('p');
  1041.     if G^.MakroLearn then mS('l');
  1042.     StatusOut(Kanal,1,3,Attrib[14],S);
  1043.   end;
  1044. End;
  1045.  
  1046.  
  1047. Procedure ScreenFill; (* Bildschirm-Schoner *)
  1048. Var    X,Y : Byte;
  1049. Begin
  1050.   ScreenSTBY := false;
  1051.   Teil_Bild_Loesch(1,maxZ,0);
  1052.   ScreenSTBY := true;
  1053.   Repeat
  1054.     X := Random(70);
  1055.   Until X in [1..70];
  1056.   Repeat
  1057.     Y := Random(maxZ);
  1058.   Until Y in [1..maxZ];
  1059.   WriteTxt(X,Y,Attrib[15],BSTOP);
  1060. End;
  1061.  
  1062.  
  1063. Procedure Check_Eig_Mail (* von,bis : Byte *);
  1064. Var   Hstr : String[9];
  1065.       i    : Byte;
  1066. Begin
  1067.   for i := von to bis do with K[i]^ do
  1068.   begin
  1069.     Hstr := OwnCall;
  1070.     strip(Hstr);
  1071.     if Exists(G^.MailPfad + Hstr + MsgExt) then
  1072.     begin
  1073.       if pos(Hstr,Eig_Mail_Zeile) = 0
  1074.       then Eig_Mail_Zeile := Eig_Mail_Zeile + B1 + Hstr;
  1075.       EigMail := true;
  1076.     end else EigMail := false;
  1077.   end;
  1078. End;
  1079.  
  1080.  
  1081. Procedure EMS_Seite_einblenden (* Kanal : Byte; Art : Byte  *);
  1082. Var       i : Byte;
  1083. Begin
  1084.   with K[Kanal]^ do
  1085.   begin
  1086.     if Art = Scr then for i := 0 to PagesAnz-1 do
  1087.                           EMS_Zuordnung(ScrHandle,i,PagesNot[i]);
  1088.     if Art = Vor then EMS_Zuordnung(VorHandle,0,Kanal);
  1089.     if EMS_Error <> 0 then Abbruch_TOP(10,int_str(EMS_Error));
  1090.   end;
  1091. End;
  1092.  
  1093.  
  1094. Procedure Open_Scroll (* Kanal : Byte *);
  1095. Begin
  1096.   with K[Kanal]^ do
  1097.   begin
  1098.     FiResult := ResetBin(ScrollFile,T);
  1099.     Seek(ScrollFile,Pos_im_Scr + NotPos);
  1100.   end;
  1101. End;
  1102.  
  1103.  
  1104. Procedure Close_Scroll (* Kanal : Byte *);
  1105. Begin
  1106.   with K[Kanal]^ do
  1107.   begin
  1108.     NotPos := FilePos(ScrollFile) - Pos_im_Scr;
  1109.     FiResult := CloseBin(ScrollFile);
  1110.   end;
  1111. End;
  1112.  
  1113.  
  1114. Function  PhantasieCall; (* : str9 *)
  1115. Var     ch   : char;
  1116.         Hstr : String[9];
  1117. Begin
  1118.   Hstr := '';
  1119.   While length(Hstr) < 7 do
  1120.   begin
  1121.     ch := #0;
  1122.     While not (ch in ['A'..'Z']) do ch := chr(Random(Byte(90)));
  1123.     Hstr := Hstr + ch;
  1124.   end;
  1125.   Hstr[4] := chr(Random(Byte(9)) + 48);
  1126.   Hstr[7] := '-';
  1127.   Hstr := Hstr + int_str(Random(Byte(15)));
  1128.   PhantasieCall := Hstr;
  1129. End;
  1130.  
  1131.  
  1132. Procedure SetzeCursor (* X,Y : ShortInt *);
  1133. Begin
  1134.   if not Cursor_on then Cursor_Ein;
  1135.   X := Byte(X);
  1136.   Y := Byte(Y);
  1137.   if (CurX <> X) or (CurY <> Y) then GotoXY(X,Y);
  1138.   CurX := X;
  1139.   CurY := Y;
  1140. End;
  1141.  
  1142.  
  1143. Procedure InitCursor (* X,Y : ShortInt *);
  1144. Begin
  1145.   if HardCur then SetzeCursor(X,Y);
  1146. End;
  1147.  
  1148.  
  1149. Procedure set_Hardwarecursor (* Kanal : Byte *);
  1150. Var   i,i1,i2,i3 : Byte;
  1151. begin
  1152.   if HardCur then with K[Kanal]^ do
  1153.   begin
  1154.     i := QBeg + 1;
  1155.     i1 := 3;
  1156.     i3 := QEnd;
  1157.     if Kanal = 0 then
  1158.     begin
  1159.       i := UnStat + 2;
  1160.       i1 := 1;
  1161.       i3 := maxZ;
  1162.     end;
  1163.     if Braille80 then i2 := 80 else i2 := 1;
  1164.  
  1165.     if NowCurBox and not NoCurJump
  1166.       then SetzeCursor(XL,i)
  1167.       else if not TNC_ReadOut then
  1168.            begin
  1169.              if (Kanal = 0) then SetzeCursor(1,UnStat);
  1170.            end else if JumpRxScr and Win_Rout then
  1171.                     begin
  1172.                       if ShTab_Pressed then SetzeCursor(i1,ObStat)
  1173.                                        else SetzeCursor(i2,i3);
  1174.                     end else
  1175.                     begin
  1176.                       if Cmd then SetzeCursor(X1C,Y1C+Vofs)
  1177.                              else SetzeCursor(X1V,Y1V+Vofs);
  1178.                     end;
  1179.   end;
  1180. End;
  1181.  
  1182.  
  1183. Procedure SwitchChannel(Kanal : Byte);
  1184. Begin
  1185.   if Kanal > 0 then PortStufe := ((Kanal-1) div 10) * 10;
  1186.   show := Kanal;
  1187.   K[Kanal]^.NochNichtGelesen := false;
  1188.   Neu_Bild;
  1189. End;
  1190.  
  1191.  
  1192. Procedure SwitchKanal (* VC : Char *);
  1193. Var   i,i1,i2 : Byte;
  1194.       Flag : Boolean;
  1195. Begin
  1196.   i := (ord(VC)-58);
  1197.   i1 := show;
  1198.  
  1199.   if maxLink > 10 then
  1200.   begin
  1201.     if i1 - PortStufe = i then
  1202.     begin
  1203.       if i1 + 10 <= maxLink then i1 := i1 + 10 else
  1204.       begin
  1205.         i1 := i;
  1206.         if i1 = 0 then i1 := maxLink;
  1207.       end;
  1208.     end else
  1209.     begin
  1210.       i1 := i + PortStufe;
  1211.       if i1 > maxLink then i1 := i;
  1212.     end;
  1213.  
  1214.     i2 := i1;
  1215.     Repeat
  1216.       if i2 + 10 <= maxLink then i2 := i2 + 10
  1217.                             else i2 := i;
  1218.       Flag := K[i2]^.NochNichtGelesen;
  1219.     Until Flag or (i2 = i1);
  1220.     if Flag then i1 := i2;
  1221.   end else i1 := i;
  1222.  
  1223.   if i1 > maxLink then i1 := maxLink;
  1224.   SwitchChannel(i1);
  1225. End;
  1226.  
  1227.  
  1228. Procedure SwitchMonitor;
  1229. Begin
  1230.   if show > 0 then
  1231.   begin
  1232.     ShowMerk := show;
  1233.     SwitchChannel(0);
  1234.   end else SwitchChannel(ShowMerk);
  1235. End;
  1236.  
  1237.  
  1238. Function  FreeStr (* Lw : char)  : str11 *);
  1239. Begin
  1240.   FreeStr := FormByte(int_str(DiskFree(ord(Lw)-64)));
  1241. End;
  1242.  
  1243.  
  1244. Function  V24 (* Kanal : Byte) : Byte *);
  1245. Begin
  1246.   V24 := TNC[K[Kanal]^.TncNummer]^.RS232;
  1247. End;
  1248.  
  1249.  
  1250. Procedure ReInstall;
  1251. Begin
  1252.   V24_Close;
  1253.   Port[$21] := Old_IntMask;
  1254.   Port[$20] := $C7;
  1255.  
  1256.   if use_EMS then EMS_Freigeben(ScrHandle);
  1257.   if Vor_im_EMS then EMS_Freigeben(VorHandle);
  1258.   if use_XMS then Free_XMS_Ram(XMS_Handle);
  1259.  
  1260.   NormVideo;
  1261.   ColorItensity(false);
  1262.   TextMode(StartVideoMode);
  1263.   ClrScr;
  1264.   Cursor_ein;
  1265. End;
  1266.  
  1267.  
  1268. Procedure ColorItensity (* CFlag : Boolean *);
  1269. var  r : Registers;
  1270.      i : Byte;
  1271. Begin
  1272.   if not Hercules then
  1273.   begin
  1274.     if CFlag then i := 0
  1275.              else i := 1;
  1276.     r.AX := $1003;
  1277.     r.BL := i;
  1278.     Intr($10,r);
  1279.   end;
  1280. End;
  1281.  
  1282.  
  1283. Function  ChAttr (* Attr : Byte ) : Byte *);
  1284. Begin
  1285.   if Attr = 13 then ChAttr := 254 else ChAttr := Attr;
  1286. End;
  1287.  
  1288.  
  1289. Procedure Init_HardDrive;
  1290. Var   r : Registers;
  1291. Begin
  1292.   r.AH := $0D;
  1293.   MsDos(r);
  1294.   HD_Read := 0;
  1295. End;
  1296.  
  1297.  
  1298. Procedure New2BVec;
  1299. Begin
  1300.   ES := Seg(TopString);
  1301.   DI := Ofs(TopString);
  1302. End;
  1303.  
  1304.  
  1305. Procedure Check_TOP_Loaded;
  1306. Var  r : Registers;
  1307.      p : ^String;
  1308. Begin
  1309.   r.ES := 0;
  1310.   r.DI := 0;
  1311.   Intr(TEI,r);
  1312.   p := Ptr(r.ES,r.DI);
  1313.  
  1314.   if (p <> nil) and (p^ = TopString) then
  1315.   begin
  1316.     Writeln(^G,'TOP already loaded !');
  1317.     Halt;
  1318.   end;
  1319. End;
  1320.  
  1321.  
  1322. Procedure TOP_Exit;
  1323. Begin
  1324.   ExitProc := OrigExit;
  1325.   ReInstall;
  1326.   GotoXY(1,25);
  1327.   Writeln(^G);
  1328. End;
  1329.  
  1330.  
  1331. Procedure PRG_Stoppen(Nr : Byte);
  1332. Begin
  1333.   ExitProc := OrigExit;
  1334.   Halt(Nr);
  1335. End;
  1336.  
  1337.  
  1338. Function  BackScroll (* Kanal : Byte) : Boolean *);
  1339. Begin
  1340.   with K[Kanal]^ do BackScroll := QsoScroll or BoxScroll or DirScroll;
  1341. End;
  1342.  
  1343.  
  1344. Procedure Call_DOS (* Zeile : Str128 *);
  1345. Begin
  1346.   SetIntVec(TEI,@New2Bvec);
  1347.   SetMemTop(Ptr(OvrHeapOrg,0));
  1348.  
  1349.   SwapVectors;
  1350.   Exec(GetEnv('COMSPEC'),Zeile);
  1351.   SwapVectors;
  1352.  
  1353.   SetMemTop(HeapEnd);
  1354.   OvrClearBuf;
  1355.   SetIntVec(TEI,Old2Bvec);
  1356. End;
  1357.  
  1358.  
  1359. Function  AppendTxt (* Var f : Text) : Integer *);
  1360. Begin
  1361.   (*$I-*) Append(f); (*$I+*)
  1362.   AppendTxt := IOResult;
  1363. End;
  1364.  
  1365.  
  1366. Function  ResetTxt (* Var f : Text) : Integer *);
  1367. Begin
  1368.   (*$I-*) Reset(f); (*$I+*)
  1369.   ResetTxt := IOResult;
  1370. End;
  1371.  
  1372.  
  1373. Function  ResetBin (* Var f : File; Fpos : LongInt) : Integer *);
  1374. Begin
  1375.   (*$I-*) Reset(f,Fpos); (*$I+*)
  1376.   ResetBin := IOResult;
  1377. End;
  1378.  
  1379.  
  1380. Function  RewriteTxt (* Var f : Text) : Integer *);
  1381. Begin
  1382.   (*$I-*) Rewrite(f); (*$I+*)
  1383.   RewriteTxt := IOResult;
  1384. End;
  1385.  
  1386.  
  1387. Function  RewriteBin (* Var f : File; Fpos : LongInt) : Integer *);
  1388. Begin
  1389.   (*$I-*) Rewrite(f,Fpos); (*$I+*)
  1390.   RewriteBin := IOResult;
  1391. End;
  1392.  
  1393.  
  1394. Function  CloseTxt (* Var f : File) : Integer *);
  1395. Begin
  1396.   (*$I-*) Close(f); (*$I+*)
  1397.   CloseTxt := IOResult;
  1398. End;
  1399.  
  1400.  
  1401. Function  CloseBin (* Var f : File) : Integer *);
  1402. Begin
  1403.   (*$I-*) Close(f); (*$I+*)
  1404.   CloseBin := IOResult;
  1405. End;
  1406.  
  1407.  
  1408. Function  EraseTxt (* Var f : File) : Integer *);
  1409. Begin
  1410.   (*$I-*) Erase(f); (*$I+*)
  1411.   EraseTxt := IOResult;
  1412. End;
  1413.  
  1414.  
  1415. Function  EraseBin (* Var f : File) : Integer *);
  1416. Begin
  1417.   (*$I-*) Erase(f); (*$I+*)
  1418.   EraseBin := IOResult;
  1419. End;
  1420.  
  1421.  
  1422. Procedure IdleDOS;
  1423. Var  r : Registers;
  1424. Begin
  1425.   r.AX := $1680;
  1426.   Intr($2F,r);
  1427. End;
  1428.  
  1429.  
  1430. Procedure Verzoegern (* Wert : Word *);
  1431. Begin
  1432.   Delay(Word(Round(Wert * DelayCor)));
  1433. End;
  1434.  
  1435.  
  1436. Procedure LockIntFlag (* Art : Byte *);
  1437. Begin
  1438.   if LockInt then
  1439.   begin
  1440.     if Art = 0 then Inline($FA)
  1441.                else Inline($FB);
  1442.   end;
  1443. End;
  1444.  
  1445.  
  1446. Function  FName_aus_FVar (* var f : File) : Str80 *);
  1447. Var    Hstr : String[80];
  1448.        i    : Byte;
  1449. Begin
  1450.   move(FileRec(f).Name,Hstr[1],80);
  1451.   i := 1;
  1452.   While (Hstr[i] > #0) and (i < 80) do inc(i);
  1453.   Hstr[0] := Chr(i-1);
  1454.   KillEndBlanks(Hstr);
  1455.   FName_aus_FVar := Hstr;
  1456. End;
  1457.